﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace iS3.DAL.SQLSERVER
{
    public class ExternalStorageEngine_Normal : IExternalStorageEngine
    {
        public string tableNameOrPrefix;
        public ExternalStorageEngine_Normal(string tableNameOrPrefix)
        {
            this.tableNameOrPrefix = tableNameOrPrefix;
        }
        public bool checkIfExist(string param)
        {
            return true;
        }

        public List<string> getAllExtTableName()
        {
            return new List<string>() { tableNameOrPrefix };
        }

        public List<string> getAllExtTableNameByParam(string param)
        {
            return getAllExtTableName();
        }

        public string getExtTableName<TEntity>(TEntity model) where TEntity : DGBase, new()
        {
            return tableNameOrPrefix;
        }

        public Dictionary<string, List<TEntity>> getExtTableName<TEntity>(List<TEntity> models) where TEntity : DGBase, new()
        {
            return new Dictionary<string, List<TEntity>>() { { tableNameOrPrefix, models } };
        }

        public string getExtTableName(string param)
        {
            return tableNameOrPrefix;
        }

        public List<string> getRelativeTableName(string param)
        {
            return new List<string>() { tableNameOrPrefix };
        }
        public ExternalStorageRecord recordCreatingTable(string tableName)
        {
            return null;
        }
    }
}
